<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			return;
			if (this.token) {
				this.$http.post('').then(res => {
					if (res.code == 200) {
						//获取用户信息
						this.$store.commit('saveInfo', {
							userinfo: res.data
						});
					} else {
						uni.showToast({
							title: '登录超时！',
							icon: 'none'
						});
						this.$store.commit('logout');
					}
					uni.hideLoading();
				});
			} else {
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData:{
					test:false,
					statusBatHeight:0
				},
				created() {
					var that = this
					wx.getSystemInfo({
						success(res) {
							// console.log('设备品牌',res.brand)
							// console.log('设备型号',res.model)
							// console.log('设备像素比',res.pixelRatio)
							// console.log('屏幕宽度',res.windowWidth)
							// console.log('屏幕高度',res.windowHeight)
							// console.log('状态栏的高度',res.statusBarHeight)
							// console.log('微信设置的语言',res.language)
							// console.log('微信版本号',res.version)
							// console.log('操作系统及平台',res.system)
							// console.log('用户自提大小',res.fontSizeSetting)
							// console.log('客户端基础库版本',res.SDKVersion)
							// console.log('height',res)
							that.$options.globalData.statusBatHeight = res.statusBarHeight
							// console.log('高度大大')
							// console.log('高度大大',that.$options.globalData.statusBatHeight)
							const model = res.model;
							        // console.log("手机信息res----" + res.model, res);
							        if (/iPhone X/i.test(model)) {
							          console.log("iPhone X", "机型");
							          that.$options.globalData.test = true;
							        } else if (/iPhone 11/i.test(model)) {
							          console.log("iPhone 11", "机型");
							          that.$options.globalData.test = true;
							        } else if (
							          /iphone\sx/i.test(model) ||
							          (/iphone/i.test(model) && /unknown/.test(model)) ||
							          /iphone\s11/.test(model)
							        ) {
							          console.log("iPhone sx/s11", "机型");
							          that.$options.globalData.test = true;
							        } else {
							          console.log("其他", "机型");
							          that.$options.globalData.test = false;
							        }
						}
					})
				}
	}
</script>

<style lang="scss">


	/*每个页面公共css */
	@import 'uview-ui/index.scss';
	@import './static/css/iconfont.css';
	/*每个页面公共css */
	@import 'static/css/common.scss';
</style>
